<template>
  <div class="d-row">
    <div class="d-form-group d-form-group-flex">
      <div class="d-form-label d-text-right">
        <label class="label-text">流程</label>
      </div>
      <div class="d-form-el">
        <FormSelecter v-model="executeId" :data="executeList" :valueKey="'id'" :textKey="'name'" />
      </div>
    </div>
  </div>
</template>

<script>
import { PanerForm } from '@daelui/vdog/dist/pages.js'
import { Dialoger, FormCalendar, FormSelecter } from '@daelui/vdog/dist/components.js'
import { EditIcon, DeleteIcon } from '@daelui/vdog/dist/icons.js'
import cuteSer from '../../../service/action/execute.action'
import { state } from '../../../service/stock/index.js'

export default {
  components: {
    PanerForm,
    FormSelecter,
    FormCalendar,
    Dialoger,
    EditIcon,
    DeleteIcon
  },

  data () {
    return {
      isEdit: false, // 是否是编辑模式
      // 流程id
      executeId: '',
      // 表单数据
      state: {},
      // 流程列表
      executeList: [],
      // 状态列表
      statusList: state.statusList
    }
  },

  methods: {
    /**
     * @function 加载数据
    */
    loadList () {
      cuteSer.queryAll().then(list => {
        this.executeList = list
      })
    }
  },

  beforeMount () {
    this.loadList()
  }
}
</script>

<style lang="less" scoped>
.d-form-label {
  width: 90px;
}
.d-form-textarea {
  min-height: 120px;
}
.row-item {
  position: relative;
  margin: 24px auto;
  padding: 8px;
  width: 200px;
  height: 200px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  .item-name {
    font-size: 14px;
  }
  .item-del {
    position: absolute;
    right: 4px;
    top: 4px;
    cursor: pointer;
  }
}
</style>
